<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>用灰度拷贝并合并图像的一部分</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imagecopymerge.html">« imagecopymerge</a></li>
      <li style="float: right;"><a href="function.imagecopyresampled.html">imagecopyresampled »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.image.html">GD 和图像处理 函数</a></li>
    <li>用灰度拷贝并合并图像的一部分</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imagecopymergegray" class="refentry">
  <div class="refnamediv">
   <h1 class="refname">imagecopymergegray</h1>
   <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagecopymergegray</span> &mdash; <span class="dc-title">用灰度拷贝并合并图像的一部分</span></p>

  </div>
  <div class="refsect1 unknown-unknown-unknown-seealsr" id="refsect1-function.imagecopymergegray-unknown-unknown-unknown-seealsr">
   <h3 class="title">说明</h3>
   <div class="methodsynopsis dc-description">
    <span class="methodname"><strong>imagecopymergegray</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">resource</span> <code class="parameter">$dst_im</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">resource</span> <code class="parameter">$src_im</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$dst_x</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$dst_y</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$src_x</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$src_y</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$src_w</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$src_h</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$pct</code></span><br>): <span class="type">bool</span></div>

   <p class="para rdfs-comment">
    将 <code class="parameter">src_im</code> 图像中坐标从
    <code class="parameter">src_x</code>，<code class="parameter">src_y </code>
    开始，宽度为 <code class="parameter">src_w</code>，高度为 <code class="parameter">src_h</code>
    的一部分拷贝到
    <code class="parameter">dst_im</code> 图像中坐标为
    <code class="parameter">dst_x</code> 和 <code class="parameter">dst_y</code>
    的位置上。两图像将根据 <code class="parameter">pct</code>
    来决定合并程度，其值范围从 0 到 100。当 <code class="parameter">pct</code> = 0
    时，实际上什么也没做，当为 100 时本函数和 <span class="function"><a href="function.imagecopy.html" class="function">imagecopy()</a></span> 完全一样。
   </p>
   <p class="para">
    本函数和 <span class="function"><a href="function.imagecopymerge.html" class="function">imagecopymerge()</a></span>
    完全一样只除了合并时通过在拷贝操作前将目标像素转换为灰度级来保留了原色度。
   </p>
   <blockquote class="note"><p><strong class="note">注意</strong>: 
    <p class="para">
     本函数添加于 PHP 4.0.6。
    </p>
   </p></blockquote>
  </div>

 </div></div></div></body></html>